package rdbms;

import java.sql.Connection;
import java.sql.DriverManager;

import DAO.DAOFactoryRDBMS;
import DAO.DIClassDAO;
import DAO.DIConceptDAO;
import DAO.DIConceptDomainDAO;
import DAO.DIDomainDAO;
import DAO.DITermDAO;
import DAO.DateDAO;
import DAO.ENSequenceDAO;
import DAO.FTConceptTimeDAO;
import DAO.FTRelationTimeDAO;
import DAO.RelationDAO;





public class RDBMSDAOFactory extends DAOFactoryRDBMS {
	
	public static Connection getConnection(final String driver, final String url, 
			final String username, final String password) throws Exception {
		try {
			Class.forName(driver);
			final Connection cntLConexao = DriverManager.getConnection(url, username, password);
			return cntLConexao;
		} catch (final Exception exc) {
			exc.printStackTrace();  // TODO Usar log para registrar a exce��o. Evitar de imprimir no console
			throw new Exception(exc.getMessage());
		}
	}
	
	public static void closeConnection(final Connection conn) {
		try { 
			if (conn != null) 
				conn.close(); 
		} catch (final Exception e) {
			e.printStackTrace(); // TODO Usar log para registrar a exce��o. Evitar de imprimir no console
		}
	}

	@Override
	public ENSequenceDAO getENSequenceDAO(String idConnection) throws Exception {
		// TODO Auto-generated method stub
		return new RDBMSENSequenceDAO(idConnection);	
	}

	@Override
	public DIConceptDomainDAO getDIConceptDomainDAO(String idConnection,
			ENSequenceDAO sequence) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public DIDomainDAO getDIDomainDAO(String idConnection,
			ENSequenceDAO sequence) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public DITermDAO getDITermDAO(String idConnection, ENSequenceDAO sequence)
			throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public FTConceptTimeDAO getFTConceptTimeDAO(String idConnection)
			throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public RelationDAO getRelation(String idConnection) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public DateDAO getDateDAO(String idConnection) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public DIClassDAO getDIClassDAO(String idConnection, ENSequenceDAO sequence)
			throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public DIConceptDAO getDIConceptDAO(String idConnection,
			ENSequenceDAO sequence) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public FTRelationTimeDAO getFTRelationTimeDAO(String idConnection)
			throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

}